package org.example.mutithread.reentrantlock;

public class Producer implements Runnable {

    private Product product;

    public Producer(Product product1) {
        this.product = product1;
    }

    @Override
    public void run() {
        int cnt = 10;
        for (int i = 0; i < cnt; i++) {
            if (i % 2 == 0) {
                product.produce("哈尔滨", "啤酒");
            } else {
                product.produce("娃哈哈", "矿泉水");
            }
        }
    }

}
